##################################################################
# File : lua/sim/unitcommandqueue.lua
# Description : UnitCommandQueue lua module
# Author : GPG
##################################################################

UnitCommandQueue = Class(moho.unit_command_queue_methods) {
    
    --[[
    Methods:
	    # Access the command queue directly
	    GetQueue()
	
	    # Return if the queue is currently empty
	    bool IsQueueEmpty()
	
	    # Return the size of the queue
	    int GetQueueSize()
	
	    # get current command (NULL if no command queued)
	    UnitCommand GetCurrentCommand()
	
	    # get next command (NULL if 1 or less commands are queued)
	    UnitCommand GetNextCommand()
	
	    # get last command in queue(NULL if 1 or less commands are queued)
	    UnitCommand GetLastCommand()
	
	    # get command of index from queue if found (NULL if not found)
	    UnitCommand GetCommandInQueue( int inCommandIdx )
	
	    # scan the queue for a particular command, and return its index or -1 if not found
	    int FindCommandIndex(CmdId cmdid)
	
	    # Insert a command into the queue at a particular index
	    nil InsertCommandToQueue( UnitCommand inNewCommand, int index )
	
	    # Add a command to the queue
	    nil AddCommandToQueue( UnitCommand inNewCommand )
	
	    # remove the first command from queue if valid
	    nil RemoveFirstCommandFromQueue()
	
	    # remove a command from queue if valid
	    bool RemoveCommandFromQueue( index or UnitCommand )
	
	    # Move the first command from the front of the queue to the back of the queue
	    nil MoveFirstCommandToBackOfQueue()
	
	    # move a specific command to the back of the queue
	    bool MoveCommandToBackOfQueue( index or UnitCommnad )
	    bool MoveCommandToBackOfQueue( UnitCommand inCommand )
	
	    # Clear the entire command queue
	    nil ClearCommandQueue()
	
	    # Abort the current active task
	    nil AbortActiveTask()
	
	    # Get/Set the count for a given command.  Will remove command if count is 0.
	    int GetCommandCount( int inCommandIndex )
	    nil SetCommandCount( int inCommandIndex, int inCommandCount )
	
	    nil SetQueueClearingCmdType( UNITCOMMAND cmdType )
	    UNITCOMMAND GetQueueClearingCmdType()
	
	    # Test to see if there is a queue of building units in the queue
	    cmds,cnt GetNumBuildCmds(int cnt)
	
	    nil UpdateCommandTarget( int inCommandIndex, Entity target )
	
	    # Trim the command queue to remove things that are no longer valid
	    nil TrimCommandQueue()
	
	    bool IsQueueDirty()
	    nil SetQueueDirty(bool flag) 
    --]]
}
